# exceptions.py
from rest_framework.views import exception_handler
from rest_framework import status

def custom_exception_handler(exc, context):
    response = exception_handler(exc, context)
    
    if response is not None:
        response.data = {
            "code": response.status_code,
            "msg": "error",
            "error": response.data,
        }
    return response